import React, { Component } from 'react';
import ReactDom from 'react-dom';
import util from "@/common/util";
import layer from "@/common/layer";
import Rate from '@/Components/rate';
import DDView from '@/Components/ddview';
import InlinePicker from '@/Components/inlinepicker';
import ReactSwiper from 'reactjs-swiper';
import axios from 'axios';
import $ from 'jquery';


class Card extends Component {
    constructor(props) {
        super(props);
        this.state = {
            cardList: []
        }
    }
    async  getCardList() {
        var id = util.getQuery().id;
        let res = await util.rjax({
            url: '/card/list?dicId=' + id,
            type: 'get',
        })
        this.setState({ cardList: res.data.rows });
    }

    componentDidMount() {
        this.getCardList()
    }

    render() {
        let cardlist = this.state.cardList.map((item, index) => {
            return (
                <li key={index}>
                    <h5>{item.name}</h5>
                    <img src={item.image} alt="" />
                    <div className="carddel">
                        {/* <p className="cardlimit">
                            <span>取现额度&nbsp;<i>{item.position}</i>&nbsp;元</span><br />
                            <span>免息期&nbsp;<i className="freetime">{item.interestFree}个月</i>&nbsp;</span>
                        </p> */}
                        <p className="cardintr">简单介绍:{item.summary}</p>
                        <p className="applybtn"><a href={item.link}>点击办理</a></p>
                    </div>
                </li>
            )
        })
        return (
            <div>
                <div id="card">
                    <ul className="cardlist">
                        {cardlist}
                    </ul>
                </div>
            </div>
        )
    }
}
ReactDom.render(<Card />, document.getElementById("app"));